#!/bin/bash
# used for making the incremental kernel diffs
# 31 July 2002: added mark match/target, bridge/br.c, bridge/Makefile;
#               deleted netsyms
# 10 September 2002: added br_forward.c

export FROM=linux-2.4.20-pre5
export TO=linux-2.4.20-pre5-ebtables
export FILE=ebtables-v2.0_vs_2.4.20-pre5.001.diff

# brouter support

diff -urN $FROM/net/bridge/br_private.h $TO/net/bridge/br_private.h > $FILE
diff -urN $FROM/include/linux/if_bridge.h $TO/include/linux/if_bridge.h >> $FILE
diff -urN $FROM/net/core/dev.c $TO/net/core/dev.c >> $FILE
diff -urN $FROM/net/bridge/br_input.c $TO/net/bridge/br_input.c >> $FILE
diff -urN $FROM/net/bridge/br_forward.c $TO/net/bridge/br_forward.c >> $FILE
diff -urN $FROM/net/bridge/br.c $TO/net/bridge/br.c >> $FILE
diff -urN $FROM/net/bridge/Makefile $TO/net/bridge/Makefile >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge.h $TO/include/linux/netfilter_bridge.h >> $FILE

# getting ebtables compilable

diff -urN $FROM/net/Makefile $TO/net/Makefile >> $FILE
diff -urN $FROM/net/Config.in $TO/net/Config.in >> $FILE

# newly created files

diff -urN $FROM/net/bridge/netfilter/Makefile $TO/net/bridge/netfilter/Makefile >> $FILE
diff -urN $FROM/net/bridge/netfilter/Config.in $TO/net/bridge/netfilter/Config.in >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebtable_filter.c $TO/net/bridge/netfilter/ebtable_filter.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebtable_nat.c $TO/net/bridge/netfilter/ebtable_nat.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebtable_broute.c $TO/net/bridge/netfilter/ebtable_broute.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_redirect.c $TO/net/bridge/netfilter/ebt_redirect.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_arp.c $TO/net/bridge/netfilter/ebt_arp.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_ip.c $TO/net/bridge/netfilter/ebt_ip.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_vlan.c $TO/net/bridge/netfilter/ebt_vlan.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_log.c $TO/net/bridge/netfilter/ebt_log.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_mark.c $TO/net/bridge/netfilter/ebt_mark.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_mark_m.c $TO/net/bridge/netfilter/ebt_mark_m.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_snat.c $TO/net/bridge/netfilter/ebt_snat.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebt_dnat.c $TO/net/bridge/netfilter/ebt_dnat.c >> $FILE
diff -urN $FROM/net/bridge/netfilter/ebtables.c $TO/net/bridge/netfilter/ebtables.c >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebtables.h $TO/include/linux/netfilter_bridge/ebtables.h >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebt_arp.h $TO/include/linux/netfilter_bridge/ebt_arp.h >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebt_ip.h $TO/include/linux/netfilter_bridge/ebt_ip.h >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebt_vlan.h $TO/include/linux/netfilter_bridge/ebt_vlan.h >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebt_log.h $TO/include/linux/netfilter_bridge/ebt_log.h >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebt_mark_t.h $TO/include/linux/netfilter_bridge/ebt_mark_t.h >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebt_mark_m.h $TO/include/linux/netfilter_bridge/ebt_mark_m.h >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebt_nat.h $TO/include/linux/netfilter_bridge/ebt_nat.h >> $FILE
diff -urN $FROM/include/linux/netfilter_bridge/ebt_redirect.h $TO/include/linux/netfilter_bridge/ebt_redirect.h >> $FILE
